--[[
* 增加技能的cd
*]]
---@class BuffEffect89 : BaseBuffEffect
BuffEffect89 = ClientFight.CreateClass("BuffEffect89", ClientFight.BaseBuffEffect)
local t = BuffEffect89
---@param fight Fight
---@param buff FighterBuff
local BuffEffect89 = "BuffEffect89";
function t:action(fight, buff, ...)
    local target = buff.target;
    local buffEffectValue = buff.buffBean.f_BuffEffectValue;
    for i = 3, table.getn(buffEffectValue) do
        local is = true;
        if (buffEffectValue[i] == 0) then
            is = false;
        end
        if is then

            local skillCd = target.parametersByObject[BuffEffect89] or {};
            local oldValue = skillCd[buffEffectValue[i]] or 0;
            oldValue = oldValue + buffEffectValue[1];
            if (oldValue > buffEffectValue[2]) then
                oldValue = buffEffectValue[2];
            end
            skillCd[buffEffectValue[i]] = oldValue;
            target.parametersByObject[BuffEffect89] = skillCd;
        end
        SkillRoleMgr.savePathFile(string.format("[%s][EFFECT]Fighter %s buff%s 触发减少技能cd(本场战斗生效): %s , ",
                fight.frame, target.fighterId, buff.modelId, getJsonStr(buffEffectValue)));
        return ClientFight.BaseBuffEffect.action(self, fight, buff, parameters);
    end
end
function t:remove(fight, buff, force, ...)
    local target = buff.target;
    parameters = {...};
    target.parametersByObject[BuffEffect89] = nil;
    return ClientFight.BaseBuffEffect.remove(self, fight, buff, force, parameters);
end
t.New()